home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
do1003.zip
/
CLEANSCR.SCR
< prev
next >
Wrap
Text File
|
1991-12-27
|
2KB
|
64 lines
*┌────────────────────────────────────────────────────────┐
*│ SCRIPT: CleanScr -- Removes comment lines from scripts │
*└────────────────────────────────────────────────────────┘
/STOP End
.clr
»by« CleanScript (Version 1, 11-19-91) »#«
* If parameter is not set, it will not be substituted.
/IF %CleanScr01 EQ "" PROCESS
:GetScriptName
*
* Use the /GETS command to get the name of the script
Enter the name of the script. Be sure to include the extension
if it is not the default "»ye«SCR»#«". Press »bo«<Enter>»#« to abort.
/SET Default ""
/GETS CleanScr01 Default "»ye«ScriptName»gy«:»#«" 40 UC
:PROCESS
/IF %CleanScr01 NE "" END
*
* Use the LK operator to check to see if the user has entered
* an extension
/IF %CleanScr01 NL "*.*" CheckCorrect
/SET CleanScr01 %CleanScr01.SCR
:CheckCorrect
/GOTOC "Process %CleanScr01 (Y/N)?" YN
:N
/GOTO GetScriptName
:Y
/EXIST %CleanScr01
:EXISTERROR
.clr bell
%CleanScr01 DOES NOT EXIST!
:GOTO GetScriptName
:EXISTOK
»bo«Processing: %CleanScr01»#«
/OPEN 1 %CleanScr01 R
/OPEN 2 @cpy(%CleanScr01,1,@pos(%CleanScr01,"."))CLN W
:ReadRecord
/READ 1 " " Line
* Use InKey to abort program before it finishes processing if
* <esc> (027) pressed
/INKEY ~027 EOF
* Use the backslash to indicate an actual asterisk ("*") followed
* by any other character.
/IF %FileBuffer NL "\**" ReadRecord
/WRITE 2 %FileBuffer
.reset
%FileBuffer
/GOTO ReadRecord
* Jump to here if there is a read error
:READERROR
.bell
»re« ERROR READING »ye«%CleanScr01»#«!
:EOF
* Jump to here at end-of-file
/CLOSE 1
/CLOSE 2
:END
* Clear all the variables used.
/ENDEXEC CLEAR
* End of CleanScript